<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box" style="width: 200px;height: 200px;"></div>
    <div id="boxid">id</div>
    <div>div</div>
    <strong>aaa</strong>
    <!-- <ul class="nav">
        <li>我的首页</li>
        <li>产品介绍</li>
        <li>联系方式</li>
    </ul> -->
    <script>
        // const nav = document.querySelectorAll('ul li')
        // for(let i=0;i<nav.length;i++){
        //     console.log(nav[i])
        // }

        const box=document.getElementById('box');
        function getRandomColor(){
            // let arr=['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f']
            // let color='#'
            // for(let i=0;i<6;i++){
            //     let rd=Math.floor(Math.random()*arr.length)
            //     color+=arr[rd]
            // }
            // return color;
            let a=Math.floor(Math.random()*256)
            let b=Math.floor(Math.random()*256)
            let c=Math.floor(Math.random()*256)
            return `rgb(${a},${b},${c})`;
        }
        box.style.backgroundColor=getRandomColor()

        const obj={
            name:'张三'
        }
        obj.name='李四'
        console.log(obj)
        const div =document.getElementById('boxid')
        div.innerHTML='<strong>张三</strong>'
    </script>
</body>
</html>